diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py
index 529400df28..611db7588d 100644
--- a/django/contrib/auth/views.py
+++ b/django/contrib/auth/views.py
@@ -47,6 +47,7 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
     template_name = 'registration/login.html'
     redirect_authenticated_user = False
     extra_context = None
+    next_page = None
 
     @method_decorator(sensitive_post_parameters())
     @method_decorator(csrf_protect)
@@ -63,6 +64,8 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
         return super().dispatch(request, *args, **kwargs)
 
     def get_success_url(self):
+        if self.next_page is not None:
+            return resolve_url(self.next_page)
         url = self.get_redirect_url()
         return url or resolve_url(settings.LOGIN_REDIRECT_URL)
 
